package com.ms.education.ucenter.controller.front;

import com.ms.education.R;
import com.ms.education.ucenter.entity.Teacher;
import com.ms.education.ucenter.service.TeacherService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>Project:education-IndexTeacherController
 * <p>Powered by ms on 2023-02-12 20:09:26
 *
 * @author ms
 * @version 1.0
 * @since 1.8
 */
@RestController
@RequestMapping("/ucenter/front/teacher")
@Api(description = "前台讲师")
public class IndexTeacherController {

    @Autowired
    private TeacherService teacherService;

    @ApiOperation("前4个讲师")
    @GetMapping("index")
    @Cacheable(value = "frontTeacher")
    public R index(){
        List<Teacher> teachers=teacherService.index();
        return R.ok().data("teachers",teachers);
    }

}
